<?php 
namespace app\models;

use think\Model;

class Region extends Model
{
    protected $pk = 'id';
    protected $autoWriteTimestamp = 'datetime';
    protected $createTime = 'created';

    public function getCountryAttr($value, $data)
    { 
        $lang = isset(request()->header()['language']) ? request()->header()['language'] : '';
        if ($lang == 'en-us') {
            $value = $data['country_us'];
        }
        return $value;
    }
}

